// pages/profile/profile.js
const app = getApp()
Page({
  /**
   * 页面的初始数据
   */
  data: {
      userListInfo:[
        {
          icon: "../../images/history.png",
          text: "测评记录",
          url: "../history/history"
        },
        {
          icon: "../../images/help.png",
          text: "测试说明",
          url: "../help/help"
        },
        {
          icon:"../../images/aboutUs.png",
          text: "开发者: 班1-组1",
          url: ""
        }
      ],
      times: 2,
      openid:null
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function () {
    
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    this.setData({
      times: app.globalData.times,
      openid:app.globalData.openid
    });
  },

  onGotUserInfo: function(){
    if (!this.data.logged && e.detail.userInfo) {
      this.setData({
        logged: true,
        avatarUrl: e.detail.userInfo.avatarUrl,
        userInfo: e.detail.userInfo
      })
    }
  },

  goDetail: function(e){
    if(e.currentTarget.dataset.index!=""){
      wx.navigateTo({
        url:e.currentTarget.dataset.index  
      })
    }
  }
})